VERSION 4.00 Begin VB.Form frmCode Caption = "Codepad Untitled" ClientHeight = 4680 ClientLeft = 1440 ClientTop = 1530 ClientWidth = 6975 Height = 5115 Icon = "frmCode.frx":0000 Left = 1380 LinkTopic = "frmCode" ScaleHeight = 4680 ScaleWidth = 6975 Top = 1155 Width = 7095 Begin VB.CommandButton cmdSaveAs Caption = "Save As" Height = 315 Left = 1605 TabIndex = 4 Top = 0 Width = 810 End Begin VB.CommandButton cmdSave Caption = "Save" Height = 315 Left = 810 TabIndex = 3 Top = 0 Width = 780 End Begin VB.CommandButton cmdClear Caption = "Clear" Height = 300 Left = 6120 TabIndex = 2 Top = 0 Width = 840 End Begin VB.CommandButton cmdBrowse Caption = "Browse" Height = 315 Left = -15 TabIndex = 1 Top = 0 Width = 810 End Begin VB.TextBox Text1 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 4380 Left = 0 MultiLine = -1 'True ScrollBars = 3 'Both TabIndex = 0 Top = 285 Width = 6975 End Begin VB.Timer Timer1 Enabled = 0 'False Interval = 4000 Left = 2880 Top = 2100 End Begin MSComDlg.CommonDialog dlgCode Left = 2295 Top = 1605 _ExtentX = 847 _ExtentY = 847 _Version = 327681 End Attribute VB_Name = "frmCode" Attribute VB_Creatable = False Attribute VB_Exposed = False Option Explicit Dim Chnge As Boolean Private Sub cmdSave_Click() Dim fnum As Integer fnum = FreeFile On Error Resume Next Open dlgCode.filename For Output As fnum Print #fnum, Text1.Text Close fnum frmCode.Caption = "Codepad " & dlgCode.filename Chnge = False End Sub Private Sub cmdClear_Click() Text1.Text = "" dlgCode.filename = "" frmCode.Caption = "Codepad Untitled" Chnge = False End Sub Private Sub cmdBrowse_Click() Dim txt As String Dim fname As String dlgCode.CancelError = True dlgCode.DialogTitle = "Open File" On Error Resume Next dlgCode.ShowOpen If Err.Number = cdlCancel Then Exit Sub End If fname = dlgCode.filename frmCode.Caption = "Codepad " & fname On Error GoTo Out Open fname For Input As #1 txt = Input(LOF(1), #1) Text1.Text = txt Close #1 Chnge = False End Sub Private Sub cmdSaveAs_Click() dlgCode.CancelError = True dlgCode.DialogTitle = "Save As" On Error Resume Next dlgCode.ShowOpen If Err.Number = cdlCancel Then Exit Sub End If cmdSave_Click End Sub Private Sub Form_Load() Timer1.Interval = 4000 With dlgCode .Filter = "Text Files:(*.txt)|*.txt|" .Filter = .Filter & "Forms:(*.frm)|*.frm|" .Filter = .Filter & "Modules:(*.bas)|*.bas|" .Filter = .Filter & "Projects:(*.vbp)|*.vbp|" .Filter = .Filter & "Classes:(*.cls)|*.cls|" End With Chnge = False End Sub Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If Chnge = True Then Cancel = True Timer1.Enabled = True Me.Hide frmClose.Show End If End Sub Private Sub Form_Resize() Text1.Height = frmCode.ScaleHeight - 265 Text1.Width = frmCode.Width - 100 cmdClear.Left = frmCode.Width - 980 End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) Chnge = True End Sub Private Sub Timer1_Timer() End Sub